package com.health.db.service.user.impl;

import java.util.List;

import com.health.db.dao.user.IPatientListDao;
import com.health.db.model.PatientList;
import com.health.db.model.PatientListExample;
import com.health.db.model.PatientListTemp;
import com.health.db.service.user.IPatientListService;

public class PatientListServiceImpl implements IPatientListService {

	
	private IPatientListDao patientListDao ;
 
	@Override
	public int addPatientList(PatientList patientList) {
		//SqlSession sqlSession = factory.openSession();
		// TODO Auto-generated method stub
		int result=-1;
		
		result=patientListDao.addPatientList(patientList);
		
		return  result;
	}

	@Override
	public int deleteByPatId(Long patId) {
		
		int result=-1;
		result=patientListDao.deleteByPatId(patId);

		return  result;
	}

	@Override
	public List<PatientListTemp> selectByPatientListSelective(PatientList paList) {
		
		List<PatientListTemp> list=patientListDao.selectByPatientListSelective(paList);
 
		return list;
	}

	@Override
	public int updatePatientList(PatientList patientList,
			PatientListExample example) {
		int result=-1;
		
		result=patientListDao.updatePatientList(patientList, example);

		return  result;
	}

	@Override
	public PatientList selectByPatientId(Long patientId) {
		
		PatientList p=patientListDao.selectByPatientId(patientId);
 
		return p;
	}

	public IPatientListDao getPatientListDao() {
		return patientListDao;
	}

	public void setPatientListDao(IPatientListDao patientListDao) {
		this.patientListDao = patientListDao;
	}


}
